import { DOWNLOAD_OPTIONS } from "../constants/actionTypes";
import storageSync from "../helper/storage-sync";

const initialState = {};

const reducers = (state = initialState, action) => {
  switch (action.type) {
    case DOWNLOAD_OPTIONS:
      action.payload["time"] = new Date().getTime();
      return {
        ...state,
        ...action.payload
      };
    default:
      return state;
  }
};

export default storageSync("option", reducers);
